package bishi2016;

import java.util.Scanner;

public class MoGuJie_MaxDiatance {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int numberCount, maxDistance = Integer.MIN_VALUE, maxDel = Integer.MAX_VALUE;
		int[] arr;
		while(scanner.hasNext()){
			numberCount = scanner.nextInt();
			arr = new int[numberCount];
			for (int i = 0; i < numberCount; i++) {
				arr[i] = scanner.nextInt();
			}
			for (int i = 1; i < arr.length; i++) {
				maxDistance = Math.max(maxDistance, arr[i] - arr[i - 1]);
			}
			maxDel = maxDistance;
			//当删除a[i]之后，最大值只可能在a[i + 1] - a[i] 和原始的最大值之间取值
			for (int i = 1; i < arr.length - 1; i++) {
				maxDel = Math.max(maxDel, arr[i + 1] - arr[i - 1]);
			}
			System.out.println(Math.min(maxDistance, maxDel));
		}
		scanner.close();
	}
	
}
